<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no,minimal-ui">
	<title>发表评论</title>
	<link rel="shortcut icon" href="${siteCompany.ico!'/static/favicon.ico'}" type="image/x-icon">
	<link rel="stylesheet" type="text/css" href="/static/libs/layui-v2.6.8/css/layui.css" />
	<script type="text/javascript" src="/static/libs/jquery/jquery-3.6.0.min.js"></script>
	<script type="text/javascript" src="/static/libs/layui-v2.6.8/layui.js"></script>
	<script type="text/javascript" src="/static/js/comment/comment.js"></script>
	<style rel="stylesheet">
		.comment-form {
			padding: 15px;
		}
		.other-title {
			font-size: 20px;
			padding: 0 15px 15px 0;
		}
		.comment-btn {
			text-align: right;
			padding: 10px 0;
		}
	</style>
</head>
<body>
<div class="comment-form">
	<div class="other-title">
		评论：${otherTitle!}
	</div>
	<div class="comment-content">
		<textarea placeholder="请输入您的评论内容" class="layui-textarea" style="height: 180px;" id="content" name="content"></textarea>
	</div>
	<div class="comment-btn">
		<button class="layui-btn layui-btn-normal" id="btn-submit">提交评论内容</button>
	</div>
</div>
<script type="text/javascript">
	var otherId = ${otherId};
	var commentType = ${commentType};
	$(function () {
		$('#btn-submit').click(function () {
			commentPost({
				"content": $('#content').val()
				, "otherId": otherId
				, "type": commentType
			}, function (json) {
				if (json.code === 0) {
					return layer.msg("恭喜您，发表评论成功！", {time: 1500}, function () {
						parent.location.reload();
					});
				} else {
					return layer.msg(json.msg, {icon: 2});
				}
			})
		});
	});
</script>
</body>
</html>